package day10.Exer;

public class PC {
    private String brand;
    private int money;
    //cpu,不要了
    //两个usb口
    private Usb b1;
    private Usb b2;
    public void show(){
        System.out.println("这台电脑牌子是："+brand+",价格是"+money+"元");
        System.out.println("两个usb口");
        System.out.println("usb 1 "+b1);
        System.out.println("usb 2 "+b2);
    }
    public  void work(){
        System.out.println(this.brand+"在工作中");
        if(b1!=null)
            b1.work();
        if(b2!=null)
            b2.work();
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public int getMoney() {
        return money;
    }

    public void setMoney(int money) {
        this.money = money;
    }

    public Usb getB1() {
        return b1;
    }

    public void setB1(Usb b1) {
        b1.plugin();
        this.b1 = b1;//！！！！设备插入usb槽口
    }

    public Usb getB2() {
        return b2;
    }

    public void setB2(Usb b2) {
        b2.plugin();
        this.b2 = b2;
    }
}
